{% extends 'siteAdmin/siteAdmin.html' %}
{% block operation %}

{% if req.path ==pageData['subdomain']|nonone +'/siteAdmin/setconfAdd' %}
<div id="box">
    <span class="testa">Aggiungi una setconf</span>
    <hr></hr>
        {% if pageData['setconf'].id %}
            <form  method="POST" action="/siteAdmin/setconfAdd?update={{pageData['setconf'].id}}">
        {% else %}
            <form  method="POST" action="/siteAdmin/setconfAdd?add">
        {% endif %}
                <span class="word">Sezione</span>
                <span class="insert"><input name="section" type="text" value ="{{pageData['setconf'].section|nonone}}" style="width: 100%"/></span><br />
                <span class="word">Chiave</span>
                <span class="insert"><input name="key" type="text" value ="{{pageData['setconf'].key|nonone}}" style="width: 100%"/></span><br />
                <span class="word">Valore</span>
                <span class="insert"><input name="value" type="text" value ="{{pageData['setconf'].value|nonone}}" style="width: 100%"/></span><br />
                <span class="word">Descrizione</span>
                <span class="insert"><input name="description" type="text" value ="{{pageData['setconf'].description|nonone}}" style="width: 100%"/></span><br />
                <input type="submit" class="wymupdate" value="Aggiungi/modifica"/></form>
        </div>

    {% elif req.path =='/siteAdmin/setconfList' %}
        <div id="box">
                <span class="testa"><h1>Gestione setconf</h1></span>

    {% include 'common/searchBox.html' with context %}

                <div class="row normal">
                <a href="/siteAdmin/setconfAdd?new">
                    <img src="/templates/siteAdmin/img/add.png" alt="aggiungi una setconf" title="aggiungi una setconf"/>
                </a>
                </div>
                {% for page in pageData['setconf'] %}
                <div class="row normal lineTop" >

                    <span ><strong>{{page.date|dateformat}}</strong> -<span style="color: #8C2323; "> {{page.section}} </span>- <strong>{{page.key}} </strong> = {{page.value[0:100]}}</span>
                    <span class="image"><a href="/siteAdmin/setconfDel?setconfId={{page.id}}" onClick='return confirm("Sei sicuro di voler cancellare questa setconf?")' ><img src="/templates/siteAdmin/img/trash.png" alt="elimina la setconf" title="elimina la setconf"/></a></span>
                    <span class="image"><a href="/siteAdmin/setconfAdd?edit={{page.id}}"><img src="/templates/siteAdmin/img/modifica.png" alt="modifica una setconf" title="modifica una setconf"/></a></span>
            {% if page.active==1 %}
            <span class="image normal" >
                <a href="/siteAdmin/setconfActive?id={{page.id}}&amp;pag={{pageData['args']['pag']+1}}">
                    <img src="/templates/siteAdmin/img/active_on.png" alt="disattiva setconf" title="disattiva setconf"/>
                </a>
            </span>
            {% endif%}
            {% if page.active==0 %}
            <span class="image normal">
                <a href="/siteAdmin/setconfActive?id={{page.id}}&amp;pag={{pageData['args']['pag']+1}}">
                    <img src="/templates/siteAdmin/img/active_off.png" alt="attiva setconf" title="attiva setconf"/>
                </a>
            </span>
            {% endif%}
                </div>
                {% endfor %}
        {% include 'common/pagination.html' with context %}
                <div class="row normal lineTop">
                <a href="/siteAdmin/setconfAdd?new">
                    <img src="/templates/siteAdmin/img/add.png" alt="aggiungi una pagina" title="aggiungi una pagina"/>
                </a>
                </div>
        </div>

{% endif %}
        </div>
{%endblock%}
